from time import time
f=open("m1_sorted.txt")
a = [int(i) for i in f]
n=len(a)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if a[j]>a[j+1]:
            a[j],a[j+1]=a[j+1],a[j]
end = time()
total = (end - start)*1000
print("m1_sorted", round(total), "milliseconds")

f=open("m2_reverse.txt")
a = [int(i) for i in f]
n=len(a)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if a[j]>a[j+1]:
            a[j],a[j+1]=a[j+1],a[j]
end = time()
total = (end - start)*1000
print("m2_reverse", round(total), "milliseconds")

f=open("m3_shuffle.txt")
a = [int(i) for i in f]
n=len(a)
start = time()
for i in range(n-1):
    for j in range(n-2,i-1,-1):
        if a[j]>a[j+1]:
            a[j],a[j+1]=a[j+1],a[j]
end = time()
total = (end - start)*1000
print("m3_shuffle", round(total), "milliseconds")
